Leadtools.Pdf Namespace > PDFFile Class > MergeWith Method : MergeWith(PDFFile[],String) Method |
public void MergeWith( PDFFile[] sourceFiles, string destinationFileName )
'Declaration Public Overloads Sub MergeWith( _ ByVal sourceFiles() As PDFFile, _ ByVal destinationFileName As String _ )
'Usage Dim instance As PDFFile Dim sourceFiles() As PDFFile Dim destinationFileName As String instance.MergeWith(sourceFiles, destinationFileName)
public void MergeWith( PDFFile[] sourceFiles, string destinationFileName )
function Leadtools.Pdf.PDFFile.MergeWith(PDFFile[],String)( sourceFiles , destinationFileName )
public: void MergeWith( array<PDFFile^>^ sourceFiles, String^ destinationFileName )
This method will merge two or more existing PDF files to form a new file containing all the pages from the pre-existing PDF files. The new file will be constructed as follows:
The pages of the PDF file associated with this PDFFile object will be first
The pages of the first file in the sourceFiles list will be appended next
The pages of the second file in the sourceFiles list will be appended next
And so on for each item in sourceFiles.
All the PDF files must pre-exist on disk and must be valid. The sourceFiles parameter must not contain any null items.
To use this method, associate this PDFFile object with a valid PDF file and optional password. You can achieve this by either using the PDFFile(string fileName) or PDFFile(string fileName, string password) constructors or set the file name and optional password directly into the FileName and Password properties. You do not need to call Load before using this method.
This method will use the following properties of this PDFFile object:
DocumentProperties. If the value of this property is null (Nothing in Visual Basic), then default properties will be used
SecurityOptions. If the value of this property is not null (Nothing in Visual Basic), then the destination file will be encrypted using the properties of this property. If the value of this property is null (Nothing in Visual Basic), the result file will not be encrypted
CompatibilityLevel. The version of the generated PDF file
If one or more of the files to merge with are encrypted with a password, then set the required password in its PDFFile item in the sourceFiles array. If none of the files are encrypted, then you can use the MergeWith(string[] sourceFileNames, string destinationFileName) version of this method that allow you to pass a list of System.String's for the file names instead.
For an example, refer to MergeWidth.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2